/////////////////////////////////////////////////////////////////////////////
// Filename: Object.h
// Description: 3D object class
/////////////////////////////////////////////////////////////////////////////

#ifndef OBJECT_H
#define OBJECT_H

#define NULL 0

#include "Vertex.h"
#include "Triangle.h"
#include "Vector3.h"
#include "Matrix4.h"
#include "Color.h"
#include "Light.h"

#include <vector>
using namespace std;

enum SHADING_TYPE{
	WIREFRAME_SHADING,
	FLAT_SHADING,
	SMOOTH_SHADING
};

class Object{
private:
	vector<Vertex> vertices;
	vector<Triangle> faces;

	//Some stuff needed for anisotropic shading:
	Vector3 anisotropy_origin;
	Vector3 anisotropy_axis; 
	Vector3 view_anisotropy_origin;
	Vector3 view_anisotropy_axis; 


	int no_faces; //number of triangles
	int no_vertices; //number of vertices

	void transform(Matrix4 view_matrix);
	void ShadeFaces(vector<Light> light_list);
	void ShadeVertices(vector<Light> light_list);
	

public:
	Matrix4 model_matrix;


public:
	Object(){
		no_faces=0;
		no_vertices=0;
		model_matrix.identity();
		anisotropy_axis=Vector3(0,1,0);
		anisotropy_origin=Vector3(0,0.5,0);
	}

	void Load_obj(const char* filename);

	void Display(Matrix4 view_matrix, vector<Light> light_list, int shading_type);
};

#endif

/////////////////////////////////////////////////////////////////////////////
//                               END OF FILE                               //
/////////////////////////////////////////////////////////////////////////////